package org.example.test11.postprocessor;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeansException;
import org.springframework.beans.MutablePropertyValues;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.stereotype.Component;

/**
 * @Author: luyg
 * @Date: 2024/07/17/19:09
 * @Description:
 */
@Slf4j
@Component
public class DogBeanFactoryPostProcessor implements BeanFactoryPostProcessor {
	@Override
	public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
		BeanDefinition dog = beanFactory.getBeanDefinition("Dog");
		MutablePropertyValues propertyValues = dog.getPropertyValues();
		propertyValues.addPropertyValue("name","dog");

	}
}
